package com.jjb.www.http.api;

import com.hjq.http.config.IRequestApi;
import com.hjq.http.config.IRequestType;
import com.hjq.http.model.BodyType;

import java.io.File;

/**
 *    author : Android CRG
 *    github : https://github.com/getActivity/AndroidProject
 *    time   : 2019/12/07
 *    desc   : 上传图片
 */
public final class UpdateImageApi implements IRequestApi, IRequestType {

    @Override
    public String getApi() {
        return "/api/attach/v2/upload/file";
    }

    @Override
    public BodyType getType() {
        // 上传文件需要使用表单的形式提交
        return BodyType.FORM;
    }

    private File file;



    public UpdateImageApi setFile(File file) {
        this.file = file;
        return this;
    }

    public final static class Bean {

        private String attach_id;
        private String path;

        public String getAttach_id() {
            return attach_id;
        }

        public void setAttach_id(String attach_id) {
            this.attach_id = attach_id;
        }

        public String getPath() {
            return path;
        }

        public void setPath(String path) {
            this.path = path;
        }
    }
}